package com.ctn.information.content;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;

import com.ctn.information.R;
import com.umeng.socialize.view.ActionBarView;

/**
 * 中心区域面板 - 企业
 * 
 * @author HLJ
 *
 */
public class BusinessFragment extends Fragment {
	
	private int mColorRes = -1;
	
	public BusinessFragment() { 
		mColorRes = R.color.darkturquoise;
	}
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		/*if (savedInstanceState != null)
			mColorRes = savedInstanceState.getInt("mColorRes2");
		int color = getResources().getColor(mColorRes);

		RelativeLayout v = new RelativeLayout(getActivity());
		v.setBackgroundColor(color);	*/	
		View v = inflater.inflate(R.layout.socialize_action_bar_dock, null);
		ViewGroup parent = (ViewGroup) v.findViewById(R.id.root);
		// 用于集成ActionBar 的ViewGroup
		ActionBarView socializeActionBar = new ActionBarView(this.getActivity(),"dzm");
		LayoutParams layoutParams = new ViewGroup.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.MATCH_PARENT);
		socializeActionBar.setLayoutParams(layoutParams);
		//添加ActionBar
		parent.addView(socializeActionBar);
		return v;
	}
	
	@Override
	public void onSaveInstanceState(Bundle outState) {
		super.onSaveInstanceState(outState);
		outState.putInt("mColorRes2", mColorRes);
	}
	
	
}
